<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:xs="http://www.w3.org/2001/XMLSchema"
  xmlns:doc="livcos.org/ns/doc"
  xmlns:j="livcos.org/ns/doc/journal"
  xmlns="http://www.w3.org/1999/xhtml"
  exclude-result-prefixes="doc j xs">

  <xsl:template match="j:journal">
    <div id="{@id}">
      <h1><xsl:value-of select="j:title"/></h1>
      <xsl:apply-templates select="j:entry">
        <xsl:sort select="@time" order="descending" />
      </xsl:apply-templates>
    </div>
  </xsl:template>
  
  <xsl:template match="j:entry">
    <div id="{@id}">
      <p class="entry_info">
        <xsl:value-of select="format-dateTime(xs:dateTime(@time), '[D].[M].[Y] [H01]:[m01]')" />
      </p>
      <p class="entry_content">
      	<span class="inlineEdit"><xsl:apply-templates /></span>
      </p>
    </div>
  </xsl:template>
  
</xsl:stylesheet>
